package com.dong.component;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ScopeMetadata;
import org.springframework.context.annotation.ScopeMetadataResolver;
import org.springframework.context.annotation.ScopedProxyMode;

/**
 * description
 *
 * @author Administrator 2021/09/02 19:53
 */
public class MyScopeMetadataResolver implements ScopeMetadataResolver {

    @Override
    public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDefinition) {
        ScopeMetadata scopeMetadata = new ScopeMetadata();
        System.out.println(beanDefinition.getScope());
        System.out.println(beanDefinition.isSingleton());
        scopeMetadata.setScopeName("myScope");
        scopeMetadata.setScopedProxyMode(ScopedProxyMode.DEFAULT);
        return scopeMetadata;
    }
}
